<?php
namespace app\user\controller;

use app\common\controller\UserBase;
use think\facade\Db;
use app\user\model\UserLog;

class Log extends UserBase
{
    protected function _initialize()
    {
        parent::_initialize();
    }

    public function index()
    {
        return $this->fetch('index');
    }
    public function index_json($limit='')
    {
        $list = UserLog::with(['user'])->order('create_time desc,id desc')->paginate($limit);
        $this->result($list);
    }

    public function truncate()
    {
        if ($this->request->isPost()) {
            Db::name('userLog')->where('shop_id', ShopId())->delete(true);
            $this->success('操作成功');
        }
    }

    
}
